<?php

namespace App\Policies;

use App\Models\Admin;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class AdminPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    //执行预先授权检查
    public function before(Admin $user,$ability)
    {
            if($user->type == 1 || $user->type == 2){
                return  true;
            }
    }
}
